﻿
namespace Patterns4Net.ArchitectureExplorer.Diagram.Relations
{
    using Patterns4Net.Attributes.Relations;

    public class Composition : Relation
    {
        public Composition(
            DiagramElement source, 
            DiagramElement target, 
            Cardinality cardinality, 
            string name = "")
            : base(source, target, cardinality, name)
        {
        }

        public Composition(
            DiagramElement source, 
            DiagramElement target, 
            Cardinality targetCardinality, 
            Cardinality sourceCardinality, 
            string name = "")
            : base(source, target, targetCardinality, sourceCardinality, name)
        {
        }

        public override object SourceArrow
        {
            get { return new CompositionArrow(); }
        }

        public override object  TargetArrow
        {
            get { return new CompositionArrow(); }
        }

        public override string TargetCardinalityString
        {
            get
            {
                if (this.TargetCardinality == Cardinality.One)
                {
                    return string.Empty;
                }

                return base.TargetCardinalityString;
            }
        }

        public override string SourceCardinalityString
        {
            get
            {
                if (this.SourceCardinality == Cardinality.One)
                {
                    return string.Empty;
                }

                return base.SourceCardinalityString;
            }
        }
    }

    public class CompositionArrow
    {        
    }
}
